package com.ysd.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.HomeDao;
import com.ysd.dao.impl.newsDao;
import com.ysd.entity.Home;
import com.ysd.entity.news;

/**
 * Servlet implementation class homeServlet
 */
@WebServlet("/homeServlet")
public class homeServlet extends HttpServlet {
	HomeDao dao=new HomeDao();
	newsDao newdao=new newsDao();
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		Home ls=dao.getAllHome();
		ArrayList<news> lss=newdao.getAllHomes();
		ArrayList<news> lsss=newdao.getAllHomees();
		req.setAttribute("us1", ls);
		req.setAttribute("us3", lss);
		req.setAttribute("us4", lsss);
		req.getRequestDispatcher("/index.jsp").forward(req, resp);
	}

}
